<!-- 数字生产 -->
<template>
  <div class="digitalProduction">
    <div class="floor">
      <div class="floor_item" :class="{ 'floor_item_active': floorIndex == index }"
        v-for="(item, index) in floorList.list">
        <div class="item_box" @click="changeFloorIndex(index)"></div>
        <span class="item_text">{{ item }}</span>
        <img class="floor_checked_icon" src="@/assets/images/digitalProduction/floor_checked_icon.png" alt=""
          v-if="floorIndex == index">
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">

//楼层列表
let floorList = reactive({
  list: ['L1', 'L2', 'L3', 'L4', 'L5', 'L6', 'L7', 'L8']
})
let floorIndex = ref(-1);//楼层选中下标
//改变选择楼层
const changeFloorIndex = (index: number) => {
  if (floorIndex.value != index) {
    floorIndex.value = index;
  }
}
</script>

<style lang="scss" scoped>
.digitalProduction {
  .floor {
    width: vh(70);
    position: absolute;
    top: vh(286);
    right: vh(228);
    z-index: 9;
    display: flex;
    flex-direction: column-reverse;

    // justify-content:flex-start;
    .floor_item {
      display: flex;
      align-items: center;

      .item_box {
        width: vh(12);
        height: vh(64);
        background: url(../../../assets/images/digitalProduction/floor.png) no-repeat;
        background-size: 100% 100%;
        margin-right: vh(14);
        cursor: pointer;
      }

      .item_text {
        font-family: DIN;
        font-weight: bold;
        font-size: 14px;
        color: #FFFFFF;
      }

      .floor_checked_icon {
        margin-left: vh(6);
        width: vh(10);
        height: auto;
      }

      &.floor_item_active {
        .item_box {
          width: vh(12);
          height: vh(64);
          background: url(../../../assets/images/digitalProduction/floor_checked.png) no-repeat;
          background-size: 100% 100%;
        }

        .item_text {
          font-family: DIN;
          font-weight: bold;
          font-size: 14px;
          color: #00E5DD;
        }
      }
    }
  }
}
</style>
